export default (list) => {
  if (list.constructor !== Array) return;
  let length = list.length;
  return new Promise(function (resolve, reject) {
    for (let func of list) {
      (async () => {
        await func();
        if (--length === 0) {
          resolve();
        }
      })();
    }
  });
};
